import Toast from "./tost.vue"
import Vue from "vue"

const ToastConstructor=Vue.extend(Toast)

function showToast(){
    const toastDom=new ToastConstructor({
        el:document.createElement("div"),
        data(){
            return {
                msg:"1234",
                show:true
            }
        },
    })

    document.body.appendChild(toastDom.$el)

    setTimeout(() => {
        toastDom.show=false
    }, 2000);
}

function tostshow() {
    Vue.prototype.$toast=showToast
}
export default tostshow